package jhunter.dao.type;

import java.util.HashMap;
import java.util.Map;

public abstract class TypeHandlerFactory {

	private static Map<String, TypeHandler> typesMap = new HashMap<String, TypeHandler>();

	public static void registType(TypeHandler typeHandler) {
		typesMap.put(typeHandler.getTypeName(), typeHandler);
	}

	static {
		registType(new StringTypeHandler());
		registType(new IntegerTypeHandler());
		
		registType(new LongTypeHandler());
		registType(new IdTypeHandler());
		
	}

	public static TypeHandler getTypeHandler(String typeName) {
		return typesMap.get(typeName);
	}

}
